import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import store from './redux/store'

ReactDOM.render(
    <App />,
    document.getElementById('root')
);

// 检测redux中状态的变化, 只要变化就调用render
store.subscribe(() => {
    // redux不更新页面, 需要自行调用setState来调用render()
    ReactDOM.render(
        <App />,
        document.getElementById('root')
    );
})